/*****************************************************************
**                                                             	**
**  Copyright (C) 2004 Amlogic,Inc.                            	**
**  All rights reserved                                        	**
**        Filename : FileList.c /Project:AVOS		       **
**        Revision : 1.1                                       	**
**                                                             	**
*****************************************************************/
#include "../menu.h"
#include "FileListEvent.h"
#include "LogoEvent.h"
#include "NetmenuSetupEvent.h"

INT32S WinFileListMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileListOnShow(hwnd, lpParam) ;
    }
    return 0 ;
}

void SetWinFileListPalette(void)
{
    YUVENTRY mask_para[4] = {0,0,0,4095};
    AWSetAlphaMask(0,4, mask_para);
    YUVENTRY palette_para[16] = {0x8000 | 16392,0x8000 | 21176,0x8000 | 17752,0x8000 | 16392,17592,19496,19832,19656,19992,18104,17673,17817,15864,15721,15912,9849};
    AWSetPalette(0,16, palette_para);
    return ;
}

void SetWinFileListPos(HWND* pControl, INT8U CurOsdSize)
{
    switch(CurOsdSize){
        default:
            RECT NormalWindowRect = {0,0,720,576};
            pControl->winrect = NormalWindowRect;
            CREATEWINDOWPARAM NormalWindowPara = {1,{{0,0,720,576},    {0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},    SetWinFileListPalette};
            AWSendMessage(pControl, WM_WINDOW_RESET_DRAW_AREA, (INT32S)&NormalWindowPara);
            break ;
    }//end of switch
    return;
}

HWND *CreateControlWinFileList(HWND* pParent,INT8U CurOsdSize)
{
    HWND* pNewControl;
    switch(CurOsdSize){
        default:
            CREATEWINDOWPARAM Normalwindow_para = {1,{{0,0,720,576},{0,0,0,0},{0,0,0,0},{0,0,0,0}},{PF_PALETTE_256,0,0,0},SetWinFileListPalette};
            //Create Menu Window -- 1
            pNewControl = AWCreateWinControl("TWindow","WinFileList",WS_OVERLAPPEDWINDOW,
		                      0,0,720,576,NULL, (INT32S)&Normalwindow_para,WinFileListMsgProc) ;
            pNewControl->win_id = 0 ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileListBKGPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 0;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 720;
            pControl->winrect.height = 576;
            pControl->draw_info_num = 9;
            RECT DrawRect576i[9] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0+48,720,480},
            {pControl->winrect.left + 24,pControl->winrect.top + 14+48,120,78},
            {pControl->winrect.left + 74,pControl->winrect.top + 142+48,22,22},
            {pControl->winrect.left + 74,pControl->winrect.top + 378+48,22,22},
            {pControl->winrect.left + 72,pControl->winrect.top + 96+48,284,40},
            {pControl->winrect.left + 82,pControl->winrect.top + 108+48,260,30},
            {pControl->winrect.left + 580,pControl->winrect.top + 32+48,74,46},
            {pControl->winrect.left + 80,pControl->winrect.top + 410+48,600,30},//tip for copy
            {pControl->winrect.left + 80,pControl->winrect.top + 410+48,600,30},
//            {pControl->winrect.left + 0,pControl->winrect.top + 0,720,48},
//            {pControl->winrect.left + 0,pControl->winrect.top + 528,720,48},
            };
            for(iLoop=0; iLoop < 9; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 0;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 720;
            pControl->winrect.height = 576;
            pControl->draw_info_num = 9;
            RECT NormalDrawRect[9] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,720,480},
            {pControl->winrect.left + 24,pControl->winrect.top + 14,120,78},
            {pControl->winrect.left + 74,pControl->winrect.top + 142,22,22},
            {pControl->winrect.left + 74,pControl->winrect.top + 378,22,22},
            {pControl->winrect.left + 72,pControl->winrect.top + 96,284,40},
            {pControl->winrect.left + 82,pControl->winrect.top + 108,260,30},
            {pControl->winrect.left + 580,pControl->winrect.top + 32,74,46},
            {pControl->winrect.left + 80,pControl->winrect.top + 410,600,30},//tip for copy
            {pControl->winrect.left + 80,pControl->winrect.top + 410,600,30},
//            {pControl->winrect.left + 0,pControl->winrect.top + 480,720,48},
//            {pControl->winrect.left + 0,pControl->winrect.top + 528,720,48},
            };
            for(iLoop=0; iLoop < 9; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileListBKGMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileListBKGOnShow(hwnd, lpParam) ;
        case WM_PAINT:
            return WinFileListBKGOnPaint(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileListBKG(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileListBKG
    HWND *pNewControl;
    switch(CurOsdSize){
        default:
            pNewControl = AWCreateWinControl("TControl","WinFileListBKG",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      0,0,720,576,pParent,0,WinFileListBKGMsgProc) ;
            pNewControl->win_id = 4 ;
            pNewControl->draw_info_num = 9;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[9] = {
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_FILE_TOP,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_PATH_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
	                      {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_TIP_BLANK,DT_RLE_BMP_DATA},//tip for copy
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA}
						};

            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetFileListPreviewPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop ;
    if(strcmp(pControl->pClass->class_name, "TFilelist"))
        return ;
    TFILELIST *pList = (TFILELIST *)pControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + (138+48);
            pControl->winrect.left = pControl->parent->winrect.left + (104);
            pControl->winrect.width = (248);
            pControl->winrect.height = (266);
            pControl->draw_info_num = 0;
            RECT DrawRect576i[0] = {
            };
            for(iLoop=0; iLoop < 0; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            pList->filelist_bmp_start_x = (10);
            pList->filelist_bmp_start_y = (0);
            pList->filelist_title_start_x = (50);
            pList->filelist_title_start_y = (6);
            pList->filelist_hint_info.draw_pos_x = pControl->winrect.left + (0);
            pList->filelist_hint_info.draw_pos_y  = pControl->winrect.top + (0);
            pList->filelist_hint_info.draw_width = (0);
            pList->filelist_hint_info.draw_height = (0);
            pList->list_up_arrow_info.draw_pos_x = pControl->winrect.left + (0);
            pList->list_up_arrow_info.draw_pos_y  = pControl->winrect.top ; 
            pList->list_up_arrow_info.draw_width = pControl->winrect.width + pList->list_up_arrow_info.draw_pos_x - pControl->winrect.left;
            pList->list_up_arrow_info.draw_height = (0);
            pList->list_down_arrow_info.draw_pos_x = pList->list_up_arrow_info.draw_pos_x;
            pList->list_down_arrow_info.draw_pos_y  = pControl->winrect.top + pControl->winrect.height - pList->list_up_arrow_info.draw_height; 
            pList->list_down_arrow_info.draw_width = pList->list_up_arrow_info.draw_width ;
            pList->list_down_arrow_info.draw_height = pList->list_up_arrow_info.draw_height;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + (138);
            pControl->winrect.left = pControl->parent->winrect.left + (104);
            pControl->winrect.width = (248);
            pControl->winrect.height = (266);
            pControl->draw_info_num = 0;
            RECT NormalDrawRect[0] = {
            };
            for(iLoop=0; iLoop < 0; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            pList->filelist_bmp_start_x = (10);
            pList->filelist_bmp_start_y = (0);
            pList->filelist_title_start_x = (50);
            pList->filelist_title_start_y = (6);
            pList->filelist_hint_info.draw_pos_x = pControl->winrect.left + (0);
            pList->filelist_hint_info.draw_pos_y  = pControl->winrect.top + (0);
            pList->filelist_hint_info.draw_width = (0);
            pList->filelist_hint_info.draw_height = (0);
            pList->list_up_arrow_info.draw_pos_x = pControl->winrect.left + (0);
            pList->list_up_arrow_info.draw_pos_y  = pControl->winrect.top ; 
            pList->list_up_arrow_info.draw_width = pControl->winrect.width + pList->list_up_arrow_info.draw_pos_x - pControl->winrect.left;
            pList->list_up_arrow_info.draw_height = (0);
            pList->list_down_arrow_info.draw_pos_x = pList->list_up_arrow_info.draw_pos_x;
            pList->list_down_arrow_info.draw_pos_y  = pControl->winrect.top + pControl->winrect.height - pList->list_up_arrow_info.draw_height; 
            pList->list_down_arrow_info.draw_width = pList->list_up_arrow_info.draw_width ;
            pList->list_down_arrow_info.draw_height = pList->list_up_arrow_info.draw_height;
            break ;
    }//end of switch
    return;
}

INT32S FileListPreviewMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return FileListPreviewOnShow(hwnd, lpParam) ;
        case WM_PAINT:
            return FileListPreviewOnPaint(hwnd, lpParam) ;
        case WM_KEYDOWN:
            return FileListPreviewOnKeyPress(hwnd, lpParam) ;
        default:
            return FileListPreviewOnOtherEvent(hwnd, msg_type, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlFileListPreview(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- FileListPreview
    HWND *pNewControl;
    TFILELIST *pList;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TFilelist","FileListPreview",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      104,138+48,248,266,pParent, 7, FileListPreviewMsgProc) ;
            pNewControl->win_id = 3 ;
            pNewControl->draw_info_num = 0;
            pList = (TFILELIST *)pNewControl;
            TFILELIST FileList576 = {{}, 0,
                          7,0,0,0,14,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_LOSE_PICKED,
                          (INT32U)ICON_FILELIST_BAR_FOCUS_PICKED,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          0,0,0,0,
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                           NULL,
                           GetNextFileListCB,
                           GetPrevFileListCB,
                           CDNewDir,
                           GetFullName,
                           CDRootDir};
            FileList576.filelist_items = pList->filelist_items ;
            FileList576.hwnd = pList->hwnd ;
            *pList =FileList576;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TFilelist","FileListPreview",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      104,138,248,266,pParent, 7, FileListPreviewMsgProc) ;
            pNewControl->win_id = 3 ;
            pNewControl->draw_info_num = 0;
            pList = (TFILELIST *)pNewControl;
            TFILELIST NormalFileList = {{}, 0,
                          7,0,0,0,14,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_LOSE,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_FOCUS,
                          (INT32U)ICON_FILELIST_BAR_LOSE_PICKED,
                          (INT32U)ICON_FILELIST_BAR_FOCUS_PICKED,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          0,0,0,0,
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                           NULL,
                           GetNextFileListCB,
                           GetPrevFileListCB,
                           CDNewDir,
                           GetFullName,
                           CDRootDir};
            NormalFileList.filelist_items = pList->filelist_items ;
            NormalFileList.hwnd = pList->hwnd ;
            *pList =NormalFileList;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileInfoBKGPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 100+48;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 294;
            pControl->winrect.height = 302;
            pControl->draw_info_num = 8;
            RECT DrawRect576i[8] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,294,302},
            {pControl->winrect.left + 20,pControl->winrect.top + 30,260,50},
            {pControl->winrect.left + 20,pControl->winrect.top + 110,260,50},//filesize
            {pControl->winrect.left + 20,pControl->winrect.top + 70,260,50}, //filetype	moveup          
            {pControl->winrect.left + 20,pControl->winrect.top + 150,260,50},
            {pControl->winrect.left + 20,pControl->winrect.top + 190,260,50},
            {pControl->winrect.left + 20,pControl->winrect.top + 230,260,50},            
            {pControl->winrect.left + 20,pControl->winrect.top + 270,260,50},
            };
            for(iLoop=0; iLoop < 8; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 100;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 294;
            pControl->winrect.height = 302;
            pControl->draw_info_num = 8;
            RECT NormalDrawRect[8] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,294,302},
            {pControl->winrect.left + 20,pControl->winrect.top + 30,260,50},
            {pControl->winrect.left + 20,pControl->winrect.top + 110,260,50},//filesize	
            {pControl->winrect.left + 20,pControl->winrect.top + 70,260,50},//filetype	moveup
            {pControl->winrect.left + 20,pControl->winrect.top + 150,260,50},
            {pControl->winrect.left + 20,pControl->winrect.top + 190,260,50},
            {pControl->winrect.left + 20,pControl->winrect.top + 230,260,50},            
            {pControl->winrect.left + 20,pControl->winrect.top + 270,260,50},
            };
            for(iLoop=0; iLoop < 8; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileInfoBKGMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileInfoBKGOnShow(hwnd, lpParam) ;
        case WM_HIDEWINDOW:
            return WinFileInfoBKGOnHide(hwnd, lpParam) ;
        case WM_PAINT:
            return WinFileInfoBKGOnPaint(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileInfoBKG(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileInfoBKG
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileInfoBKG",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      358,100+48,294,302,pParent,0,WinFileInfoBKGMsgProc) ;
            pNewControl->win_id = 3 ;
            pNewControl->draw_info_num = 8;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[8] = {
                          {0,0,0,0,(INT32U)ICON_FILELIST_INFO_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},                          
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},                          
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
            	          };
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileInfoBKG",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      358,100,294,302,pParent,0,WinFileInfoBKGMsgProc) ;
            pNewControl->win_id = 3 ;
            pNewControl->draw_info_num = 8;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[8] = {
                          {0,0,0,0,(INT32U)ICON_FILELIST_INFO_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},                          
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},                          
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          };
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileMusicBKGPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 100+48;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 294;
            pControl->winrect.height = 302;
            pControl->draw_info_num = 1;
            RECT DrawRect576i[1] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,294,302},
            };
            for(iLoop=0; iLoop < 1; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 100;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 294;
            pControl->winrect.height = 302;
            pControl->draw_info_num = 1;
            RECT NormalDrawRect[1] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,294,302},
            };
            for(iLoop=0; iLoop < 1; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileMusicBKGMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileMusicBKGOnShow(hwnd, lpParam) ;
        case WM_PAINT:
            return WinFileMusicBKGOnPaint(hwnd, lpParam) ;
        case WM_KEYDOWN:
            return WinFileMusicBKGOnKeyPress(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileMusicBKG(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileMusicBKG
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileMusicBKG",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      358,100+48,294,302,pParent,0,WinFileMusicBKGMsgProc) ;
            pNewControl->win_id = 6 ;
            pNewControl->draw_info_num = 1;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[1] = {
                          {0,0,0,0,(INT32U)ICON_FILELIST_MUSIC_BACKGROUND,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileMusicBKG",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      358,100,294,302,pParent,0,WinFileMusicBKGMsgProc) ;
            pNewControl->win_id = 6 ;
            pNewControl->draw_info_num = 1;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[1] = {
                          {0,0,0,0,(INT32U)ICON_FILELIST_MUSIC_BACKGROUND,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileSpectrumPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 110+48;
            pControl->winrect.left = pControl->parent->winrect.left + 374;
            pControl->winrect.width = 126;
            pControl->winrect.height = 100;
            pControl->draw_info_num = 17;
            RECT DrawRect576i[17] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,126,100},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 10,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 20,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 30,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 40,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 50,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 60,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 70,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 80,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 90,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 100,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 110,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 120,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 130,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            };
            for(iLoop=0; iLoop < 17; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 110;
            pControl->winrect.left = pControl->parent->winrect.left + 374;
            pControl->winrect.width = 126;
            pControl->winrect.height = 100;
            pControl->draw_info_num = 17;
            RECT NormalDrawRect[17] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,126,100},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 10,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 20,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 30,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 40,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 50,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 60,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 70,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 80,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 90,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 100,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 110,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 120,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 130,pControl->winrect.top + 0,8,100},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,0,0},
            };
            for(iLoop=0; iLoop < 17; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileSpectrumMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileSpectrumOnShow(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileSpectrum(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileSpectrum
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileSpectrum",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      374,110+48,126,100,pParent,0,WinFileSpectrumMsgProc) ;
            pNewControl->win_id = 7 ;
            pNewControl->draw_info_num = 17;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[17] = {
                          {0,0,0,0,(INT32U)ICON_MUSIC_SPECTRUM_BK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileSpectrum",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      374,110,126,100,pParent,0,WinFileSpectrumMsgProc) ;
            pNewControl->win_id = 7 ;
            pNewControl->draw_info_num = 17;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[17] = {
                          {0,0,0,0,(INT32U)ICON_MUSIC_SPECTRUM_BK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileVolumePos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 32+48;
            pControl->winrect.left = pControl->parent->winrect.left + 580;
            pControl->winrect.width = 74;
            pControl->winrect.height = 46;
            pControl->draw_info_num = 2;
            RECT DrawRect576i[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,50,46},
            {pControl->winrect.left + 50,pControl->winrect.top + 0,24,46},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 32;
            pControl->winrect.left = pControl->parent->winrect.left + 580;
            pControl->winrect.width = 74;
            pControl->winrect.height = 46;
            pControl->draw_info_num = 2;
            RECT NormalDrawRect[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,50,46},
            {pControl->winrect.left + 50,pControl->winrect.top + 0,24,46},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileVolumeMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileVolumeOnShow(hwnd, lpParam) ;
        case WM_PAINT:
            return WinFileVolumeOnPaint(hwnd, lpParam) ;
        case WM_KEYDOWN:
            return WinFileVolumeOnKeyPress(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileVolume(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileVolume
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileVolume",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      580,32+48,74,46,pParent,0,WinFileVolumeMsgProc) ;
            pNewControl->win_id = 8 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[2] = {
                          {0,0,0,0,(INT32U)ICON_SPEAKER,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_VOLUME0,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileVolume",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      580,32,74,46,pParent,0,WinFileVolumeMsgProc) ;
            pNewControl->win_id = 8 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[2] = {
                          {0,0,0,0,(INT32U)ICON_SPEAKER,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_VOLUME0,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileListProcessBarPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 226+48;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 290;
            pControl->winrect.height = 42;
            pControl->draw_info_num = 6;
            RECT DrawRect576i[6] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,230,42},
            {pControl->winrect.left + 8,pControl->winrect.top + 4,32,32},
            {pControl->winrect.left + 230,pControl->winrect.top + 0,60,42},
            {pControl->winrect.left + 236,pControl->winrect.top + 10,80,32},
            {pControl->winrect.left + 42,pControl->winrect.top + 4,32,32},
            {pControl->winrect.left + 94,pControl->winrect.top + 16,132,8},
            };
            for(iLoop=0; iLoop < 6; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 226;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 290;
            pControl->winrect.height = 42;
            pControl->draw_info_num = 6;
            RECT NormalDrawRect[6] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,230,42},
            {pControl->winrect.left + 8,pControl->winrect.top + 4,32,32},
            {pControl->winrect.left + 230,pControl->winrect.top + 0,60,42},
            {pControl->winrect.left + 236,pControl->winrect.top + 10,80,32},
            {pControl->winrect.left + 42,pControl->winrect.top + 4,32,32},
            {pControl->winrect.left + 94,pControl->winrect.top + 16,132,8},
            };
            for(iLoop=0; iLoop < 6; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileListProcessBarMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileListProcessBarOnShow(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileListProcessBar(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileListProcessBar
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileListProcessBar",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      358,226+48,284,42,pParent,0,WinFileListProcessBarMsgProc) ;
            pNewControl->win_id = 9 ;
            pNewControl->draw_info_num = 6;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[6] = {
                          {0,0,0,0,(INT32U)ICON_MUSIC_PLAY_BAR,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_INFO_PLAY,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_MUSIC_TIME_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)mediabox_time_str,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)ICON_INFO_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_MUSIC_PROCESSBAR_BLANK,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileListProcessBar",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      358,226,284,42,pParent,0,WinFileListProcessBarMsgProc) ;
            pNewControl->win_id = 9 ;
            pNewControl->draw_info_num = 6;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[6] = {
                          {0,0,0,0,(INT32U)ICON_MUSIC_PLAY_BAR,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_INFO_PLAY,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_MUSIC_TIME_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)mediabox_time_str,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)ICON_INFO_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_MUSIC_PROCESSBAR_BLANK,DT_RLE_BMP_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileListMusicInfoPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 268+48;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 294;
            pControl->winrect.height = 134;
            pControl->draw_info_num = 5;
            RECT DrawRect576i[5] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,294,134},
            {pControl->winrect.left + 4,pControl->winrect.top + 6,250,30},
            {pControl->winrect.left + 4,pControl->winrect.top + 36,250,30},
            {pControl->winrect.left + 4,pControl->winrect.top + 66,250,30},
            {pControl->winrect.left + 4,pControl->winrect.top + 96,250,30},
            };
            for(iLoop=0; iLoop < 5; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 268;
            pControl->winrect.left = pControl->parent->winrect.left + 358;
            pControl->winrect.width = 294;
            pControl->winrect.height = 134;
            pControl->draw_info_num = 5;
            RECT NormalDrawRect[5] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,294,134},
            {pControl->winrect.left + 4,pControl->winrect.top + 6,250,30},
            {pControl->winrect.left + 4,pControl->winrect.top + 36,250,30},
            {pControl->winrect.left + 4,pControl->winrect.top + 66,250,30},
            {pControl->winrect.left + 4,pControl->winrect.top + 96,250,30},
            };
            for(iLoop=0; iLoop < 5; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

HWND *CreateControlWinFileListMusicInfo(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileListMusicInfo
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileListMusicInfo",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      358,268+48,294,134,pParent,0,NULL) ;
            pNewControl->win_id = 10 ;
            pNewControl->draw_info_num = 5;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[5] = {
                          {0,0,0,0,(INT32U)ICON_MUSIC_INFO_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)debug_string[0],DT_STRING_DATA},
                          {0,0,0,0,(INT32U)debug_string[1],DT_STRING_DATA},
                          {0,0,0,0,(INT32U)debug_string[2],DT_STRING_DATA},
                          {0,0,0,0,(INT32U)debug_string[3],DT_STRING_DATA}};
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
 	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileListMusicInfo",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      358,268,294,134,pParent,0,NULL) ;
            pNewControl->win_id = 10 ;
            pNewControl->draw_info_num = 5;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[5] = {
                          {0,0,0,0,(INT32U)ICON_MUSIC_INFO_BLANK,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)debug_string[0],DT_STRING_DATA},
                          {0,0,0,0,(INT32U)debug_string[1],DT_STRING_DATA},
                          {0,0,0,0,(INT32U)debug_string[2],DT_STRING_DATA},
                          {0,0,0,0,(INT32U)debug_string[3],DT_STRING_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileListUpgradePos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 130+48;
            pControl->winrect.left = pControl->parent->winrect.left + 374;
            pControl->winrect.width = 267;
            pControl->winrect.height = 194;
            pControl->draw_info_num = 10;
            RECT DrawRect576i[10] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,267,194},
            {pControl->winrect.left + 20,pControl->winrect.top + 20,190,30},
            {pControl->winrect.left + 20,pControl->winrect.top + 52,190,30},
            {pControl->winrect.left + 20,pControl->winrect.top + 84,190,30},//UpgradeInfo
            {pControl->winrect.left + 10,pControl->winrect.top + 138,110,44},
            {pControl->winrect.left + 136,pControl->winrect.top + 138,110,44},
            {pControl->winrect.left + 20,pControl->winrect.top + 84,190,30},            
            {pControl->winrect.left + 10,pControl->winrect.top + 138,236,44},
            {pControl->winrect.left + 20,pControl->winrect.top + 40,190,30},
            {pControl->winrect.left + 20,pControl->winrect.top + 60,190,30},
            };
            for(iLoop=0; iLoop < 10; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 130;
            pControl->winrect.left = pControl->parent->winrect.left + 374;
            pControl->winrect.width = 267;
            pControl->winrect.height = 194;
            pControl->draw_info_num = 10;
            RECT NormalDrawRect[10] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,267,194},
            {pControl->winrect.left + 20,pControl->winrect.top + 20,190,30},
            {pControl->winrect.left + 20,pControl->winrect.top + 52,190,30},
            {pControl->winrect.left + 20,pControl->winrect.top + 84,190,30},//UpgradeInfo
            {pControl->winrect.left + 10,pControl->winrect.top + 138,110,44},
            {pControl->winrect.left + 136,pControl->winrect.top + 138,110,44},
            {pControl->winrect.left + 20,pControl->winrect.top + 84,190,30},            
            {pControl->winrect.left + 10,pControl->winrect.top + 138,236,44},
            {pControl->winrect.left + 20,pControl->winrect.top + 40,190,30},
            {pControl->winrect.left + 20,pControl->winrect.top + 60,190,30},
            };
            for(iLoop=0; iLoop < 10; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}
INT32S WinFileListUpgradeMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileListUpgradeOnShow(hwnd, lpParam) ;
        case WM_PAINT:
            return WinFileListUpgradeOnPaint(hwnd, lpParam) ;
        case WM_KEYDOWN:
            return WinFileListUpgradeOnKeyPress(hwnd, lpParam) ;
    }
    return 0 ;
}
extern char UPGRADEFILE_STR[20];

extern char upgrade_swVersion_str[];
extern char upgrade_swBuildDate_str[];
extern unsigned int upgrade_platformID;



HWND *CreateControlWinFileListUpgrade(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileListUpgrade
    
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileListUpgrade",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      374,130+48,267,194,pParent,0,WinFileListUpgradeMsgProc) ;
            pNewControl->win_id = 11 ;
            pNewControl->draw_info_num = 10;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[10] = {
                          {0,0,0,0,(INT32U)ICON_UPGRADE_BACKGROUND,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)upgrade_model,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},             //UPGRADEFILE_STR
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},             //UpgradeInfo
                          {0,0,0,0,(INT32U)ICON_YES_LOSE,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_NO_FOCUS,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},            //ICON_UPGRADE_BLANK
			     {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},             //ICON_UPGRADE_PERCENT_INFOBAR
                          {0,0,0,0,(INT32U)upgrade_swVersion_str,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)upgrade_swBuildDate_str,DT_STRING_DATA},
			}; 
			
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileListUpgrade",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      374,130,267,194,pParent,0,WinFileListUpgradeMsgProc) ;
            pNewControl->win_id = 11 ;
            pNewControl->draw_info_num = 10;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[10] = {
                          {0,0,0,0,(INT32U)ICON_UPGRADE_BACKGROUND,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)upgrade_model,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},             //UPGRADEFILE_STR
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},             //UpgradeInfo
                          {0,0,0,0,(INT32U)ICON_YES_LOSE,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)ICON_NO_FOCUS,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},            //ICON_UPGRADE_BLANK
   			     {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},             //ICON_UPGRADE_PERCENT_INFOBAR		  
                          {0,0,0,0,(INT32U)upgrade_swVersion_str,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)upgrade_swBuildDate_str,DT_STRING_DATA},
			}; 
			
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileListCopyDelBKGPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 100+48;
            pControl->winrect.left = pControl->parent->winrect.left + 364;
            pControl->winrect.width = 284;
            pControl->winrect.height = 302;
            pControl->draw_info_num = 26;
            RECT DrawRect576i[26] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,284,320},
            {pControl->winrect.left + 34,pControl->winrect.top + 74,214,30},
            {pControl->winrect.left + 34,pControl->winrect.top + 106,214,30},
            {pControl->winrect.left + 38,pControl->winrect.top + 74,214,30},
            {pControl->winrect.left + 38,pControl->winrect.top + 106,206,30},
            {pControl->winrect.left + 26,pControl->winrect.top + 24,214,30},
            {pControl->winrect.left + 26,pControl->winrect.top + 56,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 24,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 56,214,30},
            {pControl->winrect.left + 8,pControl->winrect.top + 34,266,194},
            {pControl->winrect.left + 8,pControl->winrect.top + 254,266,40},
            {pControl->winrect.left + 8,pControl->winrect.top + 34,266,254},
            {pControl->winrect.left + 26,pControl->winrect.top + 88,214,30},
            {pControl->winrect.left + 26,pControl->winrect.top + 120,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 88,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 120,214,30},
            {pControl->winrect.left + 80,pControl->winrect.top + 200,112,44},
            {pControl->winrect.left + 90,pControl->winrect.top + 210,112,44},
            {pControl->winrect.left + 8,pControl->winrect.top + 94,266,194},
            {pControl->winrect.left + 126,pControl->winrect.top + 100,22,22},
            {pControl->winrect.left + 126,pControl->winrect.top + 250,22,22},
            {pControl->winrect.left + 80,pControl->winrect.top + 130,112,44},
            {pControl->winrect.left + 90,pControl->winrect.top + 140,112,44},
            {pControl->winrect.left + 20,pControl->winrect.top + 200,110,44},
            {pControl->winrect.left + 146,pControl->winrect.top + 200,110,44}, 
            {pControl->winrect.left + 38,pControl->winrect.top + 106,206,30},
            };
            for(iLoop=0; iLoop < 26; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 100;
            pControl->winrect.left = pControl->parent->winrect.left + 364;
            pControl->winrect.width = 284;
            pControl->winrect.height = 302;
            pControl->draw_info_num = 27;
            RECT NormalDrawRect[27] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,284,320},
            {pControl->winrect.left + 34,pControl->winrect.top + 74,214,30},
            {pControl->winrect.left + 34,pControl->winrect.top + 106,214,30},
            {pControl->winrect.left + 38,pControl->winrect.top + 74,214,30},
            {pControl->winrect.left + 38,pControl->winrect.top + 106,206,30},
            {pControl->winrect.left + 26,pControl->winrect.top + 24,214,30},
            {pControl->winrect.left + 26,pControl->winrect.top + 56,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 24,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 56,214,30},
            {pControl->winrect.left + 8,pControl->winrect.top + 34,266,194},
            {pControl->winrect.left + 8,pControl->winrect.top + 254,266,50},
            {pControl->winrect.left + 8,pControl->winrect.top + 34,266,254},
            {pControl->winrect.left + 26,pControl->winrect.top + 88,214,30},
            {pControl->winrect.left + 26,pControl->winrect.top + 120,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 88,214,30},
            {pControl->winrect.left + 30,pControl->winrect.top + 120,214,30},
            {pControl->winrect.left + 80,pControl->winrect.top + 200,112,44},
            {pControl->winrect.left + 90,pControl->winrect.top + 210,112,44},
            {pControl->winrect.left + 8,pControl->winrect.top + 94,266,194},
            {pControl->winrect.left + 126,pControl->winrect.top + 100,22,22},
            {pControl->winrect.left + 126,pControl->winrect.top + 250,22,22},
            {pControl->winrect.left + 80,pControl->winrect.top + 130,112,44},
            {pControl->winrect.left + 90,pControl->winrect.top + 140,112,44},
            {pControl->winrect.left + 20,pControl->winrect.top + 200,110,44},
            {pControl->winrect.left + 146,pControl->winrect.top + 200,110,44},
            {pControl->winrect.left + 38,pControl->winrect.top + 74,214,30},
            {pControl->winrect.left + 38,pControl->winrect.top + 106,206,30},
            };
            for(iLoop=0; iLoop < 27; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

INT32S WinFileListCopyDelBKGMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_PAINT:
            return WinFileListCopyDelBKGOnPaint(hwnd, lpParam) ;
        case WM_KEYDOWN:
            return WinFileListCopyDelBKGOnKeyPress(hwnd, lpParam) ;
	 default : 
 	     return WinFileListCopyDelBKGOnOtherEvent(hwnd, msg_type, lpParam) ;
		 
    }
    return 0 ;
}

HWND *CreateControlWinFileListCopyDelBKG(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileListCopyDelBKG
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","WinFileListCopyDelBKG",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      364,100+48,284,302,pParent,0,WinFileListCopyDelBKGMsgProc) ;
            pNewControl->win_id = 12 ;
            pNewControl->draw_info_num = 27;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO DrawDatas576[27] = {
                          {0,0,0,0,(INT32U)ICON_COPYDEL_BKG,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
			     {0,0,0,0,(INT32U)0,DT_STRING_DATA}};
            memcpy(pNewControl->draw_info,DrawDatas576, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","WinFileListCopyDelBKG",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      364,100,284,302,pParent,0,WinFileListCopyDelBKGMsgProc) ;
            pNewControl->win_id = 12 ;
            pNewControl->draw_info_num = 27;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[27] = {
                          {0,0,0,0,(INT32U)ICON_COPYDEL_BKG,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA},
                          {0,0,0,0,(INT32U)0,DT_STRING_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

void SetWinFileListCopyDelPos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop ;
    if(strcmp(pControl->pClass->class_name, "TFilelist"))
        return ;
    TFILELIST *pList = (TFILELIST *)pControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + (230+48);
            pControl->winrect.left = pControl->parent->winrect.left + (400);
            pControl->winrect.width = (214);
            pControl->winrect.height = (120);
            pControl->draw_info_num = 0;
            RECT NormalDrawRect[0] = {
            };
            for(iLoop=0; iLoop < 0; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            pList->filelist_bmp_start_x = (0);
            pList->filelist_bmp_start_y = (0);
            pList->filelist_title_start_x = (4);
            pList->filelist_title_start_y = (4);
            pList->filelist_hint_info.draw_pos_x = pControl->winrect.left + (0);
            pList->filelist_hint_info.draw_pos_y  = pControl->winrect.top + (0);
            pList->filelist_hint_info.draw_width = (0);
            pList->filelist_hint_info.draw_height = (0);
            pList->list_up_arrow_info.draw_pos_x = pControl->winrect.left + (0);
            pList->list_up_arrow_info.draw_pos_y  = pControl->winrect.top ; 
            pList->list_up_arrow_info.draw_width = pControl->winrect.width + pList->list_up_arrow_info.draw_pos_x - pControl->winrect.left;
            pList->list_up_arrow_info.draw_height = (0);
            pList->list_down_arrow_info.draw_pos_x = pList->list_up_arrow_info.draw_pos_x;
            pList->list_down_arrow_info.draw_pos_y  = pControl->winrect.top + pControl->winrect.height - pList->list_up_arrow_info.draw_height; 
            pList->list_down_arrow_info.draw_width = pList->list_up_arrow_info.draw_width ;
            pList->list_down_arrow_info.draw_height = pList->list_up_arrow_info.draw_height;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + (230);
            pControl->winrect.left = pControl->parent->winrect.left + (400);
            pControl->winrect.width = (214);
            pControl->winrect.height = (120);
            pControl->draw_info_num = 0;
            RECT DrawRect576i[0] = {
            };
            for(iLoop=0; iLoop < 0; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &DrawRect576i[iLoop], sizeof(RECT));
            pList->filelist_bmp_start_x = (0);
            pList->filelist_bmp_start_y = (0);
            pList->filelist_title_start_x = (4);
            pList->filelist_title_start_y = (4);
            pList->filelist_hint_info.draw_pos_x = pControl->winrect.left + (0);
            pList->filelist_hint_info.draw_pos_y  = pControl->winrect.top + (0);
            pList->filelist_hint_info.draw_width = (0);
            pList->filelist_hint_info.draw_height = (0);
            pList->list_up_arrow_info.draw_pos_x = pControl->winrect.left + (0);
            pList->list_up_arrow_info.draw_pos_y  = pControl->winrect.top ; 
            pList->list_up_arrow_info.draw_width = pControl->winrect.width + pList->list_up_arrow_info.draw_pos_x - pControl->winrect.left;
            pList->list_up_arrow_info.draw_height = (0);
            pList->list_down_arrow_info.draw_pos_x = pList->list_up_arrow_info.draw_pos_x;
            pList->list_down_arrow_info.draw_pos_y  = pControl->winrect.top + pControl->winrect.height - pList->list_up_arrow_info.draw_height; 
            pList->list_down_arrow_info.draw_width = pList->list_up_arrow_info.draw_width ;
            pList->list_down_arrow_info.draw_height = pList->list_up_arrow_info.draw_height;
            break ;
    }//end of switch
    return;
}

INT32S WinFileListCopyDelMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
        case WM_SHOWWINDOW:
            return WinFileListCopyDelOnShow(hwnd, lpParam) ;
        case WM_PAINT:
            return WinFileListCopyDelOnPaint(hwnd, lpParam) ;
        case WM_KEYDOWN:
            return WinFileListCopyDelOnKeyPress(hwnd, lpParam) ;
    }
    return 0 ;
}

HWND *CreateControlWinFileListCopyDel(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- WinFileListCopyDel
    HWND *pNewControl;
    TFILELIST *pList;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TFilelist","WinFileListCopyDel",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      400,230+48,214,120,pParent, 4, WinFileListCopyDelMsgProc) ;
            pNewControl->win_id = 15 ;
            pNewControl->draw_info_num = 0;
            pList = (TFILELIST *)pNewControl;
            TFILELIST FileList576 = {{}, 0,
                          4,0,0,0,14,
                          (INT32U)ICON_COPYDEL_LOSE,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_LOSE,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_LOSE,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          0,0,0,0,
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                           NULL,
                           GetNextFileListCB,
                           GetPrevFileListCB,
                           CDNewDir,
                           GetFullName,
                           CDRootDir_OnlyDir};
            FileList576.filelist_items = pList->filelist_items ;
            FileList576.hwnd = pList->hwnd ;
            *pList =FileList576;
            break ;
		
	 case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TFilelist","WinFileListCopyDel",(WS_CHILDWINDOW | WS_DISVISIBLE),
		                      400,230,214,120,pParent, 4, WinFileListCopyDelMsgProc) ;
            pNewControl->win_id = 15 ;
            pNewControl->draw_info_num = 0;
            pList = (TFILELIST *)pNewControl;
            TFILELIST NormalFileList = {{}, 0,
                          4,0,0,0,14,
                          (INT32U)ICON_COPYDEL_LOSE,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_LOSE,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          (INT32U)ICON_COPYDEL_LOSE,
                          (INT32U)ICON_COPYDEL_FOCUS,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          DT_RLE_BMP_DATA,
                          0,0,0,0,
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,0,0,(INT32U)0,DT_RESOURCE_STRING_DATA},
                           NULL,
                           GetNextFileListCB,
                           GetPrevFileListCB,
                           CDNewDir,
                           GetFullName,
                           CDRootDir_OnlyDir};
            NormalFileList.filelist_items = pList->filelist_items ;
            NormalFileList.hwnd = pList->hwnd ;
            *pList =NormalFileList;
            break ;
    }//end of switch
            return pNewControl;
}

INT32S StringRotateMsgProc(PHWND hwnd, INT32U msg_type, INT32S lpParam)
{
    switch( msg_type){
		case WM_SHOWWINDOW:
			//return StringRotateOnShow(hwnd, lpParam) ;

		case WM_PAINT:
			//return StringRotateOnPaint(hwnd, lpParam);
		break;
			default:
		break;
    }
    return 0 ;
}

void SetStringRotatePos(HWND* pControl, INT8U CurOsdSize)
{
    int iLoop;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pControl->winrect.top = pControl->parent->winrect.top + 0;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 198;
            pControl->winrect.height = 36;
            pControl->draw_info_num = 2;
            RECT Draw576DrawRect[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,198,36},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,160,36},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &Draw576DrawRect[iLoop], sizeof(RECT));
            break ;
            
        case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pControl->winrect.top = pControl->parent->winrect.top + 0;
            pControl->winrect.left = pControl->parent->winrect.left + 0;
            pControl->winrect.width = 198;
            pControl->winrect.height = 36;
            pControl->draw_info_num = 2;
            RECT NormalDrawRect[2] = {
            {pControl->winrect.left + 0,pControl->winrect.top + 0,198,36},
            {pControl->winrect.left + 0,pControl->winrect.top + 0,160,36},
            };
            for(iLoop=0; iLoop < 2; iLoop++)
                memcpy(&(pControl->draw_info[iLoop]), &NormalDrawRect[iLoop], sizeof(RECT));
            break ;
    }//end of switch
    return;
}

HWND *CreateControlStringRotate(HWND *pParent,INT8U CurOsdSize)
{
    //Create Control -- StringRotate
    HWND *pNewControl;
    switch(CurOsdSize){
        case OsdSize576i:
	 case OsdSize576p:
	 case OsdSize576iCVBS:
            pNewControl = AWCreateWinControl("TControl","StringRotate",(WS_CHILDWINDOW | WS_CHILDWINDOW),
							  0,0,198,36,pParent,0,StringRotateMsgProc) ;
            pNewControl->win_id = 5 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO Draw576DrawDatas[2] = {
            			  {0,0,198,36,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,160,36,(INT32U)0,DT_VOSD_DATA}};
            memcpy(pNewControl->draw_info,Draw576DrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
            
        case OsdSize480i:
	 case OsdSize480p:
	 case OsdSize480iCVBS:
    #ifdef SUPPORT_VGA
	 case OsdSizeVga:
    #endif
            pNewControl = AWCreateWinControl("TControl","StringRotate",(WS_CHILDWINDOW | WS_CHILDWINDOW),
		                      0,0,198,36,pParent,0,StringRotateMsgProc) ;
            pNewControl->win_id = 5 ;
            pNewControl->draw_info_num = 2;
            pNewControl->draw_info = (PDRAWINFO)AVMem_umalloc(sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            DRAWINFO NormalDrawDatas[2] = {
            			  {0,0,198,36,(INT32U)0,DT_RLE_BMP_DATA},
                          {0,0,160,36,(INT32U)0,DT_VOSD_DATA}};
            memcpy(pNewControl->draw_info,NormalDrawDatas, sizeof(DRAWINFO) * pNewControl->draw_info_num) ;
            break ;
    }//end of switch
            return pNewControl;
}

HWND* CreateMenuWinFileList(void)
{
    HWND *pNewControl ;
    TWINDOWS *pWin;
    HWND *pWinFileList = CreateControlWinFileList(NULL,CurrentOsdSize);
    SetWinFileListPos(pWinFileList,CurrentOsdSize);

    pNewControl= CreateControlFileListPreview(pWinFileList,CurrentOsdSize);
    SetFileListPreviewPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileInfoBKG(pWinFileList,CurrentOsdSize);
    SetWinFileInfoBKGPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileListBKG(pWinFileList,CurrentOsdSize);
    SetWinFileListBKGPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlStringRotate(pWinFileList,CurrentOsdSize);
    SetStringRotatePos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileMusicBKG(pWinFileList,CurrentOsdSize);
    SetWinFileMusicBKGPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileSpectrum(pWinFileList,CurrentOsdSize);
    SetWinFileSpectrumPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileVolume(pWinFileList,CurrentOsdSize);
    SetWinFileVolumePos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileListProcessBar(pWinFileList,CurrentOsdSize);
    SetWinFileListProcessBarPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileListMusicInfo(pWinFileList,CurrentOsdSize);
    SetWinFileListMusicInfoPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileListUpgrade(pWinFileList,CurrentOsdSize);
    SetWinFileListUpgradePos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileListCopyDelBKG(pWinFileList,CurrentOsdSize);
    SetWinFileListCopyDelBKGPos(pNewControl,CurrentOsdSize);

    pNewControl= CreateControlWinFileListCopyDel(pWinFileList,CurrentOsdSize);
    SetWinFileListCopyDelPos(pNewControl,CurrentOsdSize);

    pWin = (TWINDOWS *)pWinFileList;
    pWin->pFocusControl = AWFindWinCtrlByName("FileListPreview");
    return pWinFileList;
}

void WinResetWinFileListControlsPos(HWND *pControl, INT8U CurOsdSize)
{
    switch(pControl->win_id){
        case 0://WinFileList
            SetWinFileListPos(pControl,CurOsdSize) ;
            break ;
        case 2://FileListPreview
            SetFileListPreviewPos(pControl,CurOsdSize) ;
            break ;	
        case 3://WinFileInfoBKG
            SetWinFileInfoBKGPos(pControl,CurOsdSize) ;
            break ;
        case 4://WinFileListBKG
            SetWinFileListBKGPos(pControl,CurOsdSize) ;
            break ;
        case 5://StringRotate
            SetStringRotatePos(pControl,CurOsdSize) ;            
            break ;    
        case 6://WinFileMusicBKG
            SetWinFileMusicBKGPos(pControl,CurOsdSize) ;
            break ;
        case 7://WinFileSpectrum
            SetWinFileSpectrumPos(pControl,CurOsdSize) ;
            break ;
        case 8://WinFileVolume
            SetWinFileVolumePos(pControl,CurOsdSize) ;
            break ;
        case 9://WinFileListProcessBar
            SetWinFileListProcessBarPos(pControl,CurOsdSize) ;
            break ;
        case 10://WinFileListMusicInfo
            SetWinFileListMusicInfoPos(pControl,CurOsdSize) ;
            break ;
        case 11://WinFileListUpgrade
            SetWinFileListUpgradePos(pControl,CurOsdSize) ;
            break ;
        case 12://WinFileListCopyDelBKG
            SetWinFileListCopyDelBKGPos(pControl,CurOsdSize) ;
            break ;
        case 15://WinFileListCopyDel
            SetWinFileListCopyDelPos(pControl,CurOsdSize) ;
            break ;
    }//end of switch
}
void WinResetWinFileListPos(HWND *pControl, INT8U CurOsdSize)
{
    HWND *pChildControl;
    if(pControl == NULL)
        pControl = AWFindWinCtrlByName("WinFileList");
    if(pControl == NULL) return ;

    WinResetWinFileListControlsPos(pControl, CurOsdSize) ;
    pChildControl = pControl->children ;
    while(pChildControl != NULL){
    	WinResetWinFileListPos(pChildControl, CurOsdSize) ;
    	pChildControl = pChildControl->siblings ;
	}
	return ;
}

